package com.serviceprovider.business.module.sp.transaction.services.dao.interfaces;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.common.Page;
import com.serviceprovider.business.module.sp.transaction.model.Batch;

//~--- JDK imports ------------------------------------------------------------

import java.util.List;

/**
 * @author mrduongnv@gmail.com
 *
 */
public interface IBatchDao {

    /**
     * Return batch by transaction ID
     */
    Batch findBatchByTransaction(int transactionId);

    /**
     * Return the list of batch by order's ID
     */
    List<Batch> findBatchByOrder(int orderId);

    /**
     * This should be matched by transaction_user_amount.user_id. The purpose of this function is to find all the batches in which this
     * payee had been paid.
     *
     * @param userId
     * @return
     */
    List<Batch> findBatchByPayee(int userId);

    /**
     * This should be matched by transaction_details.userid. The purpose of this function is to find all the batches created by this
     * service-provider.
     *
     * @param userid
     * @return
     */
    List<Batch> findBatchByServiceProvider(int userid);

    /**
     * Return batch by batch's ID
     */
    Batch findBatchById(int id);

    /**
     * Insert batch to database
     */
    Batch insertBatch(Batch batch);

    /**
     * Update batch information
     */
    void updateBatch(Batch batch);

    /**
     * Delete batch in database
     */
    void deleteBatch(int id);

    void deleteBatch(List<Integer> deletedBatchId);

    /**
     * Pagination for batch
     */
    Page<Batch> find(int pageNumber, int pageSize, String sortColumn, String sortOrder);

    /**
     * Return all of the batchs in database
     */
    List<Batch> findAll();

    List<Batch> findToPlaceOrder(List<Integer> batchIds);
}



